//
//  TTTWareController.m
//  ProjectDemo
//
//  Created by IOS3 on 2018/12/10.
//  Copyright © 2018 IOS3. All rights reserved.
//

#import "TTTWareController.h"
#import "YJCWaveView.h"
#import "YJCWaveLineView.h"
#import "TestPresentRedController.h"
#import "TestPresentBlueController.h"
#import "AppDelegate.h"
#import <MBProgressHUD.h>


@interface TTTWareController ()

@end

@implementation TTTWareController

- (void)viewDidLoad {
    [super viewDidLoad];
    
//    self.view.backgroundColor = UIColor.blueColor;
    
    
//
//    UIImage *image = [UIImage animatedImageWithImages:@[[UIImage imageNamed:@"loadCloud_1"], [UIImage imageNamed:@"loadCloud_2"], [UIImage imageNamed:@"loadCloud_3"], [UIImage imageNamed:@"loadCloud_4"], [UIImage imageNamed:@"loadCloud_5"], ] duration:1];
//    UIImageView *imageView = [[UIImageView alloc] initWithImage:image];
//    imageView.center = self.view.center;
////    imageView.size = CGSizeMake(50, 50);
////    [self.view addSubview:imageView];
//
////    MBProgressHUD *mbp = [MBProgressHUD showMessage:nil ToView:self.view];
//    MBProgressHUD *mbp = [MBProgressHUD showHUDAddedTo:self.view animated:true];
//    mbp.mode = MBProgressHUDModeCustomView;
//    mbp.customView = imageView;
//    mbp.bezelView.style = MBProgressHUDBackgroundStyleSolidColor;
//    mbp.bezelView.backgroundColor = UIColor.clearColor;
//    mbp.removeFromSuperViewOnHide = YES;
//
//    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
////        [MBProgressHUD hideHUDForView:self.view];
//        [MBProgressHUD hideHUD];
//    });
//

    
    UIView *view = [[UIView alloc] init];
    view.backgroundColor = UIColor.redColor;
    [self.view addSubview:view];

    [view mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.view);
        make.top.mas_equalTo(self.view);
        make.width.height.mas_equalTo(100);
    }];
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        [UIView animateWithDuration:3 animations:^{
            [view mas_updateConstraints:^(MASConstraintMaker *make) {
                make.top.mas_equalTo(self.view).offset(300);
            }];
        }];
    });
    
    
    
}


- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
    
    [self presentViewController:TestPresentRedController.new animated:YES completion:nil];
    
//    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
//        
//        AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
//        if (appDelegate.window.rootViewController.presentedViewController) {
//            [appDelegate.window.rootViewController.presentedViewController dismissViewControllerAnimated:NO completion:nil];
//            [appDelegate.window.rootViewController presentViewController:TestPresentBlueController.new animated:YES completion:nil];
//        }
//        
//        
//    });
}

@end
